#include "FrontendState.h"


FrontendState::FrontendState()
{
}


FrontendState::~FrontendState(void)
{
}

 void FrontendState::Load()
 {
	mBackground.Load("bob_weave_background.png");
	mSound.Load("POL-the-boxer-short.wav");
    mSound.Play(true);
	mFont.Load(20);
	mCursor.Load("Boxing_glove.png");

	mStartButton1.Load("button_on.png", "button_off.png");
	mStartButton1.SetPosition(SVector2(425.0f, 550.0f));
	mStartButton1.SetText("START", 255, 255, 255);

	
	mQuitButton.Load("button_on.png", "button_off.png");
	mQuitButton.SetPosition(SVector2(425.0f, 600.0f));
	mQuitButton.SetText("QUIT", 255, 255, 255);
 }

 void FrontendState::Unload()
 {
	 mBackground.Unload();
	 mSound.Unload();
	 mFont.Unload();
	 mCursor.Unload();
	 mStartButton1.Unload();
	 mQuitButton.Unload();
 }

NextState FrontendState::Update(float deltaTime)
 {
	
	 mCursor.Update(deltaTime);
	 mStartButton1.Update(deltaTime);
	 mQuitButton.Update(deltaTime);
	 NextState nextState = None;
	 if (mStartButton1.IsPressed())
	 {
		
		 nextState = Gameplay;
	 }
	 else if (mQuitButton.IsPressed())
	 {
		 nextState = Quit;
	 }

	 return nextState;
 }

 void FrontendState::Render()
 {   mBackground.Render();
	 mStartButton1.Render();
	 mQuitButton.Render();
	 mCursor.Render();
 }
